#! /bin/sh
gap=10
PANEL_HEIGHT=25
export gap
export PANEL_HEIGHT

#This creates negative padding equal to window gap so that gaps are shown only between windows and not on desktop edges.
bspc config window_gap $gap;
bspc config top_padding $(($PANEL_HEIGHT-$gap))
bspc config left_padding -$gap
bspc config right_padding -$gap
bspc config bottom_padding -$gap

#Various settings
bspc config gapless_monocle     false #Default setup uses negative padding, and gapless monocle looks really weird like that
bspc config borderless_monocle  true
bspc config single_monocle true
bspc config paddingless_monocle false
#bspc config ignore_ewmh_focus      true
#bspc config initial_polarity second_child
bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true
## Honor size hints: do not make windows smaller than they wish to be
#bspc config honor_size_hints true 

##Color settings
bspc config focused_border_color "#1ABB9B"
bspc config normal_border_color "#2D2D2D"
#"#000000"
bspc config presel_feedback_color "#1ABB9B"
#"#8F3724"
bspc config border_width 2

bspc config focus_follows_pointer true
#bspc config pointer_follows_focus true #Some keybindings automatically enable and disable this setting

#Settings for manual splitting
bspc config split_ratio         0.52

#bspc monitor -d i ii iii iv v vi vii viii ix x
#bspc monitor -d One Two Three Four Five Six Seven Eight Nine Ten
#bspc monitor -d I II III IV V VI VII VIII IX X
#bspc monitor -d • • • • • • • • • •
bspc monitor -d I II III IV V VI

###This creates and names desktops for multiple monitors.
#workspaces_multimonitor &

bspc rule -a screenkey --unmanage
bspc rule -a gcolor2 state=floating center=true
bspc rule -a lxappearance state=floating center=true
bspc rule -a gmrun state=floating center=true
bspc rule -a lxterminal state=floating center=true sticky=true
bspc rule -a Manjaro-hello state=floating center=true
#bspc rule -a urxvt state=floating center=true
bspc rule -a viewnior state=floating center=true
bspc rule -a file-roller state=floating center=true
bspc rule -a floaterm state=floating center=true
bspc rule -a spotify state=pseudo_tiled
#bspc rule -a nautilus state=pseudo_tiled
#bspc rule -a skype state=pseudo_tiled
bspc rule -a file-roller state=pseudo_tiled
bspc rule -a transmission-gtk state=pseudo_tiled
bspc rule -a conky sticky=on manage=off lower=on
bspc rule -a astime sticky=on
bspc rule -a yad state=floating
bspc rule -a Docky layer=above border=off manage=on
bspc rule -a Plank layer=above border=off manage=on
bspc rule -a wbar layer=above
bspc rule -a dockbarx layer=above
bspc rule -a google-chrome-unstable private=on
bspc rule -a google-chrome-stable private=on
bspc rule -a chromium private=on
bspc rule -a firefox private=on
bspc rule -a midori private=on
bspc rule -a gnome-pie border=off manage=off
bspc rule -a wpa_gui state=pseudo_tiled
bspc rule -a libreoffice state=tiled
bspc rule -a '*:libreofficedev' state=tiled
bspc rule -a '*:soffice' state=tiled
#bspc rule -a firefox desktop=I
#bspc rule -a calibre desktop=II
#bspc rule -a geany desktop=II
#bspc rule -a deluge desktop=III
bspc rule -a 9menu border=off manage=off
bspc rule -a tint2 border=off manage=off
#bspc desktop I --layout monocle
#bspc desktop II --layout monocle


##  Autogap adjusts windowgap automatically according to the number of
##  windows on the desktop. Using it disables negative window gap.
#autogap &

##  This script balances all windows when new one is spawned 
#euclid_balancer &

##Edge-switcher switches to next workspace when moves moves to the 
##edge of the monitor (behavior similar to enlightenment)
#edge-switcher &

###External rules
##Pseudo automatic mode: always splits focused window when opening new window
bspc config external_rules_command /usr/bin/pseudo_automatic_mode
##Adjust new window: splits biggest windows to keep windows about the same size
#bspc config external_rules_command /usr/bin/adjust-new-window

##Autostart apps
#Keybindings daemon
#sxhkd &
#Source autostartfile. Uncomment this if you use bspwm-git
#. $HOME/.config/bspwm/autostart
xsetroot -cursor_name left_ptr &
bspc config top_padding 16 &